package com.hilinos.common.util;

import org.springframework.util.ObjectUtils;

public class FileUtils {

    /**
     * 获取文件后缀名
     *
     * @param name 文件名或路径
     * @return
     */
    public static String getPrefix(String name) {
        if (ObjectUtils.isEmpty(name)) {
            return null;
        }
        int index = name.lastIndexOf('.');
        if (index <= 0) {
            return null;
        }
        return name.substring(name.lastIndexOf('.'));
    }

}
